package Data::Conveyor::YAML::Active::CurrentDateYYYYMMDD;

# $Id: CurrentDateYYYYMMDD.pm 9275 2005-06-21 13:58:39Z gr $

use warnings;
use strict;
use YAML::Active qw/assert_hashref hash_activate/;


our $VERSION = '0.02';


use base 'Class::Scaffold::YAML::Active';


sub yaml_activate {
    my ($self, $phase) = @_;
    assert_hashref($self);
    my $hash = hash_activate($self, $phase);

    my ($y, $m, $d) = sub { $_[5] + 1900, $_[4] + 1, $_[3] }->(localtime);

    exists $hash->{year}  and $y += $hash->{year};
    exists $hash->{month} and $m += $hash->{month};
    exists $hash->{day}   and $d += $hash->{day};

    sprintf "%4d%02d%02d", $y, $m, $d;
}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - stage-based conveyor-belt-like ticket handling system

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

None yet. This is an early release; fully functional, but undocumented. The
next release will have more documentation.

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

